package com.ititer.dao.impl;

import static com.ititer.util.MyBatisCriteriaFactory.newCriteria;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ititer.dao.LoginLogDao;
import com.ititer.mapper.LoginLogMapper;
import com.ititer.model.LoginLog;
import com.ititer.model.LoginLogCriteria;

@Repository
public class LoginLogDaoImpl implements LoginLogDao {
	@Autowired
	private LoginLogMapper loginLogMapper;

	@Override
	public int create(LoginLog loginLog) {
		return loginLogMapper.insert(loginLog);
	}

	@Override
	public int count(Integer accountid) {
		LoginLogCriteria example = newCriteria(LoginLogCriteria.class);
		example.createCriteria().andAccountIdEqualTo(accountid);
		return loginLogMapper.countByExample(example);
	}
}
